<?php include 'header.php'; ?>


<h1>Hotel Locations</h1>


<script type='text/template' id='loctemplate'>

  {{#each objects}}

  
  
		<div class="well">
            <h1>{{hotel_name}} - {{star_rating_description}}</h1>
            <p>Address: {{street_address}}</p>
            <p><a href="http://{{hotel_URL}}" class="btn btn-primary btn-large">Visit Hotel Web Site &raquo;</a></p>
        </div>
  {{/each}}
   
</script>

<script type="text/javascript">


function loadLocations()
{
var xmlhttp;
var txt,x,i;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
	
	var data=JSON.parse(xmlhttp.responseText);
	
	var source   = $("#loctemplate").html();
	var template = Handlebars.compile(source);
	$("#content").html( template({objects:data}) );
	
	
	
    }
  }
xmlhttp.open("GET","db/HotelListingSearch.php",true);
xmlhttp.send();


}



$(document).ready(function(){

$(function(){

	
	loadLocations();
    
    
});

});

</script>


<div id="content">
Loading ...
</div>
	  
<?php include 'footer.php'; ?>